import 'package:flutter/material.dart';
import 'package:flutter_todolist/db/db.dart';
import 'package:flutter_todolist/pages/auth/auth_login.dart';
import 'package:flutter_todolist/pages/info_setting/info_setting.dart';
import 'package:flutter_todolist/utils/get_storage.dart';
import 'package:flutter_todolist/widgets/app_button.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:get/get.dart';

import '../../util.dart';
import '../home/home.dart';

class OnBoarding extends StatefulWidget {
  const OnBoarding({Key? key}) : super(key: key);

  @override
  OnBoardingState createState() => OnBoardingState();
}

class OnBoardingState extends State<OnBoarding> {

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Container(
          width: MediaQuery.of(context).size.width / 1.2,
          child: Column(
            children: <Widget>[
              Expanded(
                flex: 8,
                child: Hero(
                  tag: 'Clipboard',
                  child: Image.asset('assets/images/Clipboard.png'),
                ),
              ),
              Expanded(
                flex: 3,
                child: Column(
                  children: const <Widget>[
                    Text(
                      'Reminders made simple',
                      style: TextStyle(
                          fontSize: 22,
                          fontWeight: FontWeight.w500,
                          color: CustomColors.TextHeader),
                    ),
                    SizedBox(height: 15),
                    Text(
                      'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pellentesque erat in blandit luctus.',
                      style: TextStyle(
                          fontSize: 17,
                          fontWeight: FontWeight.w400,
                          color: CustomColors.TextBody,
                          fontFamily: 'opensans'),
                      textAlign: TextAlign.center,
                    ),
                  ],
                ),
              ),
              Expanded(
                flex: 1,
                child: AppButton(
                  content: 'Get Started',
                  gradientColors: const [
                    CustomColors.GreenLight,
                    CustomColors.GreenDark,
                  ],
                  boxShadow: const [
                    BoxShadow(
                      color: CustomColors.GreenShadow,
                      blurRadius: 15.0,
                      spreadRadius: 7.0,
                      offset: Offset(0.0, 0.0),
                    ),
                  ],
                  onTap: () {
                    AppStorage().write(AppStorage.FirstOpen, false);
                    Get.to(() => AuthPage());
                  },
                )
              ),
              Expanded(
                flex: 1,
                child: Container(),
              )
            ],
          ),
        ),
      ),
    );
  }

}
